
// Variables

// egen id= group(wbcountryname)				 
//	xtset id year

// gen domtaxrev_sum_gdp = incometax_pctgdp + goodstax_pctgdp
//  gen tradetaxgd_polity2 = tradetaxgdp*e_polity2
// gen lngdpcap_wb = log(gdppercapitacurrentus) 
// gen lnpop_wdi = log(populationtotalsppoptotl)





// FINAL TABLE


xi: xtpcse domtaxrev_sum_gdp   l.(tradetaxgdp e_polity2 tradetaxgd_polity2 ) d.(tradetaxgdp e_polity2 tradetaxgd_polity2 ) i.id if oecd==0 , pairwise corr(psar1)
// title: XTPCSE Error Correction 

xtregar domtaxrev_sum_gdp   l.(tradetaxgdp e_polity2 tradetaxgd_polity2 )  if oecd==0 , fe
// title: XTREGAR

xtreg domtaxrev_sum_gdp   l.(tradetaxgdp e_polity2 tradetaxgd_polity2 )  if oecd==0 , ro cluster(id)
// title: XTREG No Fixed Effects


xtreg domtaxrev_sum_gdp   l.(tradetaxgdp e_polity2 tradetaxgd_polity2 lngdpcap_wb lnpop_wdi  kaopen mineralrentsofgdpnygdpminrrtzs coalrentsofgdpnygdpcoalrtzs forestrentsofgdpnygdpfrstrtzs naturalgasrentsofgdpnygdpngasrtz oilrentsofgdpnygdppetrrtzs) year90s year00s i.id if oecd==0 , ro cluster(id)
// title: XTREG Controlling for Resource Rents Disagreggated


xtreg domtaxrev_sum_gdp   l.(tradetaxgdp e_polity2 tradetaxgd_polity2 lngdpcap_wb lnpop_wdi  kaopen totalnaturalresourcesrentsofgdpn) year90s year00s i.id if oecd==0 , ro cluster(id)
// title: XTREG Controlling for Total Resource Rents



// Final margins 
xtreg domtaxrev_sum_gdp   l.(tradetaxgdp e_polity2 tradetaxgd_polity2 lngdpcap_wb lnpop_wdi  kaopen totalnaturalresourcesrentsofgdpn) year90s year00s i.id if oecd==0 , ro cluster(id)


lincom l.tradetaxgdp + l.tradetaxgd_polity2*10
lincom l.tradetaxgdp + l.tradetaxgd_polity2*9
lincom l.tradetaxgdp + l.tradetaxgd_polity2*8
lincom l.tradetaxgdp + l.tradetaxgd_polity2*7
lincom l.tradetaxgdp + l.tradetaxgd_polity2*6
lincom l.tradetaxgdp + l.tradetaxgd_polity2*5
lincom l.tradetaxgdp + l.tradetaxgd_polity2*4
lincom l.tradetaxgdp + l.tradetaxgd_polity2*3
lincom l.tradetaxgdp + l.tradetaxgd_polity2*2
lincom l.tradetaxgdp + l.tradetaxgd_polity2*1
lincom l.tradetaxgdp + l.tradetaxgd_polity2*0
lincom l.tradetaxgdp + l.tradetaxgd_polity2*-1
lincom l.tradetaxgdp + l.tradetaxgd_polity2*-2
lincom l.tradetaxgdp + l.tradetaxgd_polity2*-3
lincom l.tradetaxgdp + l.tradetaxgd_polity2*-4
lincom l.tradetaxgdp + l.tradetaxgd_polity2*-5
lincom l.tradetaxgdp + l.tradetaxgd_polity2*-6
lincom l.tradetaxgdp + l.tradetaxgd_polity2*-7
lincom l.tradetaxgdp + l.tradetaxgd_polity2*-8
lincom l.tradetaxgdp + l.tradetaxgd_polity2*-9
lincom l.tradetaxgdp + l.tradetaxgd_polity2*-10
